Added tag sorting to getAllTags function