fix nextRank filled with undefined