Add __exit__ method