fix condition always false on bestvalue