updated program to check if the  variable is empty and unset