just before publish