fix double call of compare method