Corrected javascript syntax errors