issue 288, overlays in connect call being lost. also added a fix for addEndpoint since it was affected too