fixed a bug with closing tags
If a closing tag did not have an opening tag it would cause the scan to end instead of ignoring the closing tag.