fixed error with error handler