fix bug where only all five region are overwritten into region(:,:,5)