close the input/output file after loading hosts