Modify thread to run daemon.