Close file when finished
Remove unnecessary argument