gives an error where index = 0
gives an error where index = 0