Fixed bug where tags are added twice or more