Revert "fix crash on auto close"

This reverts commit 0d74db8136aee784bfabac3722552dec320a678b.
sensibly fix crash on auto close