Added duplicate label catch and fixed the remove logic.