fixes for handling parse errors in JS and HTML
fixes for parse errors in JS and HTML