fixed randomize blocks bug