fixed indexOutOfBoundsException with nestedBricks