fixed bug in autocomplete