made the publish function more explicit