Correcting issues with multiple purge queries building up conditions as well as not properly resetting the cycle complete flag