use weak_ptr instead of raw pointers in JobGroup