fix tag handling