save and open states using filter for .ser file format