diff --git a/ui/src/routes/devices.$id.tsx b/ui/src/routes/devices.$id.tsx
index f2b7aac3..70050804 100644
--- a/ui/src/routes/devices.$id.tsx
+++ b/ui/src/routes/devices.$id.tsx
@@ -478,16 +478,10 @@ export default function KvmIdRoute() {
       
 
       
 {
-          e.stopPropagation();
-        }}
+        onKeyUp={e => e.stopPropagation()}
         onKeyDown={e => {
           e.stopPropagation();
-          if (e.key === "Escape") {
-            if (location.pathname !== "/other-session") {
-              navigate("..");
-            }
-          }
+          if (e.key === "Escape") navigate("..");
         }}
       >