array name count index issue solved

Element name array index count was not incrementing properly due to varible overrite. now it's fixed!