fix edit bug with rank going to zero