Move scope_for_namespace inside generator block.