tweak some codes for normalize