Add failsafe to handle_errors