Putting variable checks in