fixed a couple of undeclared vars