New version which returns with error for failures.