Fixed bug with thread hanging and not exiting