corrected if condition ("file already complete")