fixed undeclared var