restrict chdir to loading files