Remove observer before destroying element.