adding isset() check

(cherry picked from commit b88497bbbcd011a27450251b558d9d8b0783a496)