Fix a security issue of daemon