fixed comparison bug