Added catch for Array Index out of Bounds Exception