UnboundLocalError: local variable 'KIT' referenced before assignment