Added check for variable existance to addGlobalDeclaration