Javascript syntax error fix