How to know if a variable is defined