Updates for array index out of bounds exception