Reverting moving getRating function to on doc ready