fix Save sate

fixing when quitting app