fail function is now called when a error occours
Merge pull request #4 from futur3/master

fail function is now called when an error occours