Added a option for saving gates after every change.