Adapted for jQuery UI autocomplete