don't clean up in cwd but in ${dir} instead