added null check to TileCache