fixes #5809 the rating max value is not working

Fixed the issue and pushed the code for review, please check it.