adding setFailurestate() method