added some synchronization statements