buffer autocomplete function