need to check if tilespan variable is defined