finish contextmanager