bug fixing related max total

bug fixing related max total