restoreIO can now be called multiple times