Added locking for the Connected dictionary. Needs to use special commands though.