Added failOnError option, to allow task-chaining