fixed weight updating issue