fix daemon mode and fix root logger handlers