Fixed errors if search returns nothing