Close file handle by using with statement