model_fit naming error in subfunction