added the autocomplete method