Limit access to dictionary and add locks