fix: check for NPE before removing pre-existing tags