Make daemon script threaded