fixing save model bug