fix comparing method