Properly handle scope destroy