Made some changes to the daemon for logging