fix invalid connect calls