Add lines to use IDL versions and swap order of deletion process of working directory