don't chdir if unnecessary