Fix issue with leak of selected tags