added "failOnNonZeroReturnCode" flag