fixed unhandled exception when connection is re-initializing e.g. upon screen rotation