rewrite children with worker function