save model function added