Fixed a bug, if best_candidate is null