fixed lev error on Integer.MAX_VALUE, using max length instead