fix syntax error in javascript