fix the bug in rating