Added a failure check by https://github.com/nallar
Merge pull request #605 from viliml/patch-10

Added a failure check