an exception handler for safety and comfort