fixed bug in normalization