Removed while-true statement in thread.