Fix attach
diff --git a/emsdk.py b/emsdk.py
index c5c4d75..d3dc541 100644
--- a/emsdk.py
+++ b/emsdk.py
@@ -1335,12 +1335,13 @@
     # Abort if detaching was not successful
     if os.path.exists(mount_point):
       raise Exception('Previous mount of Firefox already exists, unable to proceed.')
+
+    run(['hdiutil', 'attach', filename])
     firefox_dir = os.path.join(mount_point, 'Firefox.app')
     if not os.path.isdir(firefox_dir):
       firefox_dir = os.path.join(mount_point, 'Firefox Nightly.app')
     if not os.path.isdir(firefox_dir):
       raise Exception('Unable to find Firefox directory inside app image.')
-    run(['hdiutil', 'attach', filename])
     shutil.copytree(firefox_dir, root)
     run(['hdiutil', 'detach', mount_point])
     collapse_subdir = None