allocation of blocks was added. fixed warnings about NULL data blocks.