fix error on rank