Updated to use attach vs submit
Changed to use EmitBatch not EmitBatchAsync