Made the causal_handler to be exception-safe