Check if online before logging out