fixing js syntax error