stackoverflow connecting, some fixes