slight change to pass in error into the failure block