fix errors in js syntax, missing semicolons