Revert "app: modify daemon implementation"

the new daemon implemetation has a fatal bug.

This reverts commit d0253239f1b52014edfe5bbb4d28a2294ea38efa.