Changed close method