added clean close method