extract tarball in image dir
diff --git a/tools/build_uec.sh b/tools/build_uec.sh
index 53ada3e..accc37b 100755
--- a/tools/build_uec.sh
+++ b/tools/build_uec.sh
@@ -44,7 +44,7 @@
 # download the base uec image if we haven't already
 if [ ! -f $tarball ]; then
     curl $uec_url -o $tarball
-    tar -Sxvzf $tarball $image_dir
+    (cd $image_dir && tar -Sxvzf $tarball)
     cp $image_dir/*.img $image_dir/disk
     cp $image_dir/*-vmlinuz-virtual $image_dir/kernel
 fi