fix formatting issue and total