Added previous daemon code