Re-implemented daemonizing