bug fix in len normalization func