Added database save to model