add daemonizing function