fix comparison bugs