Add case if query term is null