fixed a bug with autocomplete