added code for responding to fatal errors.