fix compare operation