fixed loop leaving out all but last folder