bug fix on daemon crash