fix tag functionality