Fixed a fatal bug due to scope issues of a TextBox.