Azure - Terraform dynamic disk counts index issue

We created an Azure VM module which can able to provision VM’s with multiple disks. In this scenario the disk count and the VM counts are dynamic.

resource "azurerm_managed_disk" "disk" {
 count = "${var.disk_count * var.vm_count}"
 name = "${element(azurerm_virtual_machine.instance.*.name, count.index % var.vm_count)}-disk${format("%02d", count.index / var.vm_count + 1)}"
 location = "${var.location}"
 resource_group_name = "${var.rg_name}"
 storage_account_type = "StandardSSD_LRS"
 create_option = "Empty"
 disk_size_gb = "${var.disk_size}"

With this, the initial build is working perfectly, but whenever we tried to scale it, the disk count index is getting out of order and trying to recreate the disks. Is there any better way to do this?