added save/load state for apps