add fclose for target