         log("OpenSmartcard status \(result)")
 
         guard result == PBSmartcardStatusSuccess else {
-            internalState = .Error(error: getError(result))
+            setErrorState(getError(result))
             return
         }
     }

                    return
                }
            } catch let error as SITHSManagerError {
                internalState = .Error(error: error)
                return
            } catch {
                internalState = .Error(error: .InternalError(error: error))
                return
            }



    private func applicationWillResignActive(notification: NSNotification) {
        log("Application Will Resign Active Notification")
        applicationInactive = true
        dispatch_async(smartcardQueue) {
            self.closeSmartcard()
        }
