solved a bug with ranking