check for variable existance before access