fix tag bug in query