lock protection added for connection dictionary