fix crash on nested popup closing