Updated autocomplete code