update master & inv