fixed undeclared varibles