fixed minor bug in model fit