store and restore your model's state