fix compare wrong code