Added a trap to be able to run DoExiTasks (cleanup temp dir)