fixing javascript