Fixed the if with equal codes