fix infiite loop in sumlist