improve: error handlers rewrite to work as they should