restor digest/watch implementaion with loop