Fix AttributeError when destroy is called