fix wrong building block_count from read and write commands