Fixed a bug in rating