Update tags.js

I have error "undefined is not a function" when I trying to add first tag. This commit fix this wrong behavior.