update weight