clean ups
Flush opened file