fix bug in sfs calculation