fixing bug which made the program crash whenever the average rating was still undefined