fix bug in daemon