updated connection handler to handle hiccups and other supported stuff