fixing tag sorting