fixed total_bar logic