fixing small bug in daemon