Fixed a bug on the autocomplete