Thread safety

Change-Id: I4d6210f43507862825124d0b96d98206161106c7