diff --git a/simuvex/plugins/view.py b/simuvex/plugins/view.py
index <HASH>..<HASH> 100644
--- a/simuvex/plugins/view.py
+++ b/simuvex/plugins/view.py
@@ -21,10 +21,12 @@ class SimRegNameView(SimStatePlugin):
             v = self.state.se.BVV(v, self.state.arch.registers[k][1]*8)
 
         try:
-            return self.state.registers.store(self.state.arch.registers[k][0], v)
+            reg_offset = self.state.arch.registers[k][0]
         except KeyError:
             raise AttributeError(k)
 
+        return self.state.registers.store(reg_offset, v)
+
     def __dir__(self):
         return self.state.arch.registers.keys()
RegView no longer throws attribute errors for KeyErrors that shouldn't have been thrown