add condition if the query returns an empty result