fix memory issue causing the same tags to be assigned repeatedly