There's no reason to set createOnBlock to false; you set it down inside the while().   Actually why don't you just declare it inside the while()?