emit after doing stuff not before