fix finding NA as the min err