fix accidental assignment of global instead of local var