fix crash when not connected