fixing the context of `newTag` function