fixed sorting when searching by tag