bugfix: the context was accessed after being released