fix undeclared variable use