Fix autocomplete bug with appending existing value