redone search function for tagging