bug fix and normaliazation