use func to update region