stop function in ranks