fix context null assert error