Fixing javascript syntax