fix error on rank

fix error on rank