changed handling of tags