before saving to branches