application now detects when user goes offline