Corrected issue with checking for variables