adding empty checks for conditions to get terms