fix some bug on daemon process.