modified syntax error handling