use a trap to delete the temporary dir