add a close method