bug fix in normalize method