Updated logic that checks for offline devices