Add a new exit signal and use it for saving data