fixed Rank bug