fixed a bug with old text reappearing when autocompleting