Want to change group_role to support multiple roles

variable “group_role” {
description = “The role to give the controlling group (group_name) over the project (defaults to project editor)”
type = string
default = “roles/editor”
}
want to change to
type =map( string)
default = {}
further, I am using
count= length(var.group_role)
group_role=element(value(var.group_role), count.index)

by doing so, it creates error: invalid memory address or nil pointer dereference

is override the parent module(Generic Terraform registry) by changing the child module .