Fixed JS model bug