Fixing attempt to change working directory to nonexistant directory