before publish