fix scope destroying