Fix issue that there will be empty space at the end of every tag