fixed standardize function