replace broken on.exit with in_dir when calling tar