publish function complete