Getting IndexOutOfBounds Exception, trying to fix.