Improve detection wether the app is connected or not.