only change directory once