Fix infinite folder issue.