update daemon to support loop