Fix reopen application problem