Bypass callback's call on the close event

* Add a flag for bypass callbacks on the close event