fixed self comparison bug