fixed syntax error in javascript