deallocate dt after qt is defined
exit after run checks so qt% isn't full of duplicate entries

also moved dt% logical and deallocation to end of loop