add daemonization functionality