update pkg before save