add min value to frequency attr to avoid division by 0