updated sharing code