I think the order of these two lines should be reversed.  And since it's something we do in two places, might be good to refactor it out into a delete_tmp_dir method