fixing text input bug