added thread saftey to ConnectedBase