check for variable is set to prevent php notices