fixing comparison bug