add partial_result function in case GUI somehow closes midway