Added Context Manager __enter__ and __exit__ functions