add base daemon code