fix auto close