Add length check + retrieve first element from search result