Properly set the parent from threading