update comparing method