fix the scoping