sub_worker steps debugged and main_worker set terminated when finished