cleanup saveModelId function