begin IndexError functionality