fix syntax error for error handling