Fix "global name 'hub' is not defined"