adding helpers for saving and quiting