added save model flag