fixed close method