updated share functions and the related sample