fix autocomplete bug