saving state of table, survining changing number of periods