add daemon sample code