Fix a case where the app could be come disconnected when resuming