Adding Daemon code