Change condition to use relative rank

No functional change