You have another issue which is very similar to this thread
You need to move inner loop to a sub-workflow