undeclared variable error fix