updated tag handling