check if sharing function exists before using it