added a thread to demo