fixed the js file to use the average rating/latest rating