add locks to dictionarys