added check for ss_total==0