Fixing isSuccess /isFailure code