Corrected code to use textDefinition properties