fixed comparison bugs