fix digest bug