Updated code which daemonize a notify process