added fix for forEach index ordering with parseDocumentDirectory