tweak javascript syntax