diff --git a/compile b/compile
index 5e89ed73c3273f3f3d8f483ab017a1fc860115a5..20a8daef3e430b23ec4ec97259f6abefa11ade4d 100755
--- a/compile
+++ b/compile
@@ -6,7 +6,7 @@ cp src/config/start.tw.proto start.tw.tmp
 find src -name '*.tw' -print >>start.tw.tmp
 mv start.tw.tmp src/config/start.tw
 
-HASH=`git log -n1 |grep commit | sed 's/commit //'`
+HASH=`git log -n1 |grep -m1 commit | sed 's/commit //'`
 
 ./devTools/tweeGo/tweego -o bin/FC_pregmod_$HASH.html src/config/start.tw