Saving data in the controller