fix ranks