added a few methods to edit and save the model from the form