fix bug that does not remove active tag