fixed undeclared variable