Added synchronization for addBlock