working tag logic