simplified code and corrected rating profile id