purge_temp.cmd was running wild because of a logic error