better daemonization, add logging