fix digest loop