fixed close logic