adding idx for attrs