bad function scope