better connection / app closing behaviors