fix textbox bugs