Fix thread hanging issue
use the trick recipe from http://code.activestate.com/recipes/496960/ to solve the problem of thread not exiting
it's exiting!