added tag decoding