disconnect whenever tab is inactive; reconnect when it becomes active again