complete the main futrues write to disk