fixed context manager class