fixed undefined variable bugs in dht.py