fix the bugs of digest generation.