fixed compare method