Fix to properly check for 'undefined'

Signed-off-by: andre-nunes <andre.garcia.nunes@gmail.com>