Added a close method