Added base on_scope_exit