fix app state refresh bug