add file save and restore feature