Fixed a bug while setting a failure value