Prevent crash if connection lost