Bug with undeclared var