Caling the cancel() function for context more.

Even if err != nil.