Fix: NameError: name 'defaultk' is not defined