added validation for ratings