javascript syntax fixes