added mid-stream variable binding