patch the loop to be comptible with 0.9.

Hopefully we can remove this patch soon when the 0.10 is out.