handling duplicate stop tags