sorting folders based on indexing from server