Added initial check for variables