fixed bugs in addTag and delTag