fix compare bug