correcting loopDir()