fixed undeclared vars