added better javascript syntax