added feature to fail on errors (on by default)