fix that the error handling is not activated if the handler state is the first state