Add 'error' check
Merge pull request #15 from cristiandouce/add-error

Add 'error' check