minor adjustment to the text control code