further fix on error handler