implement update hook