fix context switch