Fix javascript syntax error in chrome