fix variable scope (again)