Daeamon mode loop fix