fix duplicate bug when there is no tag