publishfunction