added IndexOutOfBoundsException() in place of returning null