add better gestion of daemon connection