Recently, a quantum private comparison with equality (QPCE) protocol based on the W state was proposed [W. Liu, Y. B. Wang, and Z. T. Jiang, Opt. Commun. 284, 3160 (2011)], However, Li et al. pointed out that there was a aw of information leak and proposed a new protocol with EPR pairs [Y. B. Li et al., Eur. Phys. J. D. 66, 110 (2012)]. To fix the flaw, we improve Liu et al.'s protocol by using a special asymmetric W state. Besides, we also find there exists a security loophole in Li et al.'s new protocol, and a feasible solution is presented to fix the loophole.