Added file close to case file writer