fixed gloabl_sum missing bug