Fixed bug in createBlocks