added support for failed lines detection for issue #22, improved connmark for issue #23