Fix a bug where StackOverflow encountered if offline