cleanup loop in dre/index.js