bug with undeclared vars