more work on the auto reopen code