clean up tag query.