fixed sum bugs