implemented daemon loop
closed #2