add sharing in main media function