detach elem after scope destroyed