added tag closed and remove function, correct cut string