Add check for no results found to avoid crash