Fix item scoping bug