Update With outOfBound And emptyArray Exceptions