fix auto change dir issue