Made a raty callback function because its used in different places