fixed bug where a new context was created for cleanup instead of reusing the existing context