Fix #1572 (saveState): create saveState feature