added sorting of the directories and pages array