fixed bug in tag validation