Fixing bug in fh where fh.close not defined

Added check to see if final file is created before submitting job