add upgrade logic to reopen