trimming tag names, only adding non empty tag names