adds error listener
Merge pull request #8 from twokul/error-listener

adds error listener