check for existence of global without ReferenceError