fix auto close issue