completed autocomplete method