fix context unloading when reattaching