fix tiling bug