Issues when taking screenshot from multiple cameras.

I am trying to take screenshots from multiple cameras(2 for now), but it isn't working. The screenshot for the 2nd camera is the same as the screenshot for the first one i.e. the screenshot for the 2nd camera is the view of the first one. Following is my script. The behaviour when using Application.CaptureScreenshot is the same.

I am unable to understand the reason. I thought it was because cam.enabled is immediately being set to false after the coroutine is started, so I tried blocking the script after calling the coroutine using

A coroutine takes a frame to execute the first time. You're basically setting as many coroutines up as there are cameras, but by the time you run the first time, the only active cams are the ones from initActiveCams.Whet I'm saying is, Update, which starts your coroutines, does not wait at all, because it's no coroutine itself. It just executes straight through.