Maybe you should provide us the full code (both cases) you are running, because beside the hardcoded %do (as Scott pointed), don't see anything wrong with your piece of code. The issue should be in the you are using it.
Cheers from Portugal.
Daniel Santos @ www.cgd.pt.
... View more