fixed inter-thread communication - bug left in connect