fix border case length rank validation