Fix the hang issue when viewing a search result with state.json file open.