fix bug in rendering a tile