Fixed race condition in adding content to tags