JavaException: java.lang.StringIndexOutOfBoundsException: begin 0, end 1, length 0