inserted clearing failureCode to fix Bug