Fix scoping problem