fix the inactive time and negated logic for offline status check