fixing undefined in text