fixed syntax error on error handler