fix a bug: daemon first