fix undeclared variable