Added code to add stats to the db.