Daemon script improved