error when the index number is negative