fix context manager