add share code function