fix change directory bug