Added checks for variables