add locking in blockstore.