@navi It might be easier to wrap each scope in a TRY_FINALLY_EXPR and add the defered statements in the finally block.