fix grouped_by_puzzle_and_amount for record history