fixed error_out to write hf to hfpath.err.headfile instead of hfpath.headfile