bug fix  - undeclared variable