fixing sorting, tagging