fix context sanity check