Add exceptions in getItem() method

add IndexOutOfBoundsExceptions in getItem().