Fixing javascript