fix a bug in computing model dim in dpm