fixed issue with division by 0 in normalize