fix bug in get_rank_in_record.py