fixed the comparison bug