Fixed thread killing itself.