fix accidental global variable declarations