fixed compare bug