test if the var is set before using