WIP rewrite restore after open/close and reload