changed threading model to use daemon