fix sharing function