fixed equality check
defensive programming for parsing Tags