not skipping to next tag at end of tag bug fix