fixed destroying of context