added autocomplete function