diff --git a/VendServer/OpenDispense.py b/VendServer/OpenDispense.py
index 0ce822341e5a886561769e0e7e029c38bfd0f3c7..a802e78277ec8091df4aa820a937c92798b7722f 100644
--- a/VendServer/OpenDispense.py
+++ b/VendServer/OpenDispense.py
@@ -116,6 +116,11 @@ class OpenDispense(DispenseInterface):
 		self._userid = info.pw_uid
 		self._username = info.pw_name
 		return True
+        def logOut(self):
+            self._loggedIn = False
+            self._disabled = False
+            self._userId = None
+            self._username = None
 
 	def addCard(self, cardId):
 		if not self.isLoggedIn():
diff --git a/VendServer/VendServer.py b/VendServer/VendServer.py
index f7bc9927048c02a3a9464b1aeab3bf3ef3d52900..aee23051b4a3936604981a91c6c7fc638ad8badf 100755
--- a/VendServer/VendServer.py
+++ b/VendServer/VendServer.py
@@ -385,7 +385,7 @@ class VendServer():
 				return
 			else:
 				self.vstatus.cur_selection += chr(key + ord('0'))
-				if self.vstatus.cur_user:
+				if self.dispense.isLoggedIn():
 					self.make_selection()
 					self.vstatus.cur_selection = ''
 					self.vstatus.time_to_autologout = time() + 8
@@ -480,8 +480,7 @@ class VendServer():
 			self.vstatus.cur_pin += chr(key + ord('0'))
 			self.vstatus.mk.set_message('PIN: '+'X'*len(self.vstatus.cur_pin))
 			if len(self.vstatus.cur_pin) == PIN_LENGTH:
-				self.dispense.authUserIdPin(self.vstatus.cur_user, self.vstatus.cur_pin)
-				if self.dispense.getUsername():
+				if self.dispense.authUserIdPin(self.vstatus.cur_user, self.vstatus.cur_pin):
 					self.vstatus.username = self.dispense.getUsername()
 					self.v.beep(0, False)
 					self.vstatus.cur_selection = ''
@@ -598,6 +597,7 @@ class VendServer():
 		key = params
 		if key == 11:
 			self.vstatus.cur_user = ''
+			self.dispense.logOut()
 			self.reset_idler()
 			return
 		
@@ -762,6 +762,7 @@ class VendServer():
 			logging.warning("Entering open door mode")
 			self.v.display("-FEED  ME-")
 			#door_open_mode(v);
+			self.dispense.logOut()
 			self.vstatus.cur_user = ''
 			self.vstatus.cur_pin = ''
 		elif params == 1:  #door closed
@@ -782,9 +783,7 @@ class VendServer():
 
 		self._last_card_id = card_id
 		
-		self.dispense.authMifareCard(card_id)
-		logging.info('Mapped card id to uid %s'%self.dispense.getUsername())
-		if not self.dispense.isLoggedIn():
+		if not self.dispense.authMifareCard(card_id):
 			self.v.beep(40, False)
 			self.vstatus.mk.set_messages(
 				[(self.center('BAD CARD'), False, 1.0),
@@ -796,6 +795,7 @@ class VendServer():
 			self.reset_idler(2)
 			return
 		elif self.dispense.isDisabled():
+			logging.info('Mapped card id to uid %s'%self.dispense.getUsername())
 			self.v.beep(40, False)
 			self.vstatus.mk.set_messages(
 				[(self.center('ACCT DISABLED'), False, 1.0),
@@ -804,6 +804,7 @@ class VendServer():
 			self.reset_idler(2)
 			return
 		else:
+			logging.info('Mapped card id to uid %s'%self.dispense.getUsername())
 			self.vstatus.cur_user = '----'
 			self.vstatus.username = self.dispense.getUsername()
 			self.vstatus.cur_selection = ''