removed redundant code that caused ArrayIndexOutOfBoundsException.