updating to accept worker_is_primary param