added some fixes to model