diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -20,7 +20,13 @@ module.exports = function (options) {
     dateFormat : 'yyyymmddHHMM',
     revType:'hash',
     transformPath : function (orgPath, rev) {
-      var newpath = orgPath +  (orgPath.indexOf('?') > -1 ? '&':'?') + options.suffix + '=' + rev;
+      var reg = new RegExp ('((\\?|\\&|\\&amp\\;)' + options.suffix + '=)([^&\\s]+)', 'gi');
+      var newpath = orgPath;
+      if(reg.test(orgPath)){
+        newpath = orgPath.replace(reg, "$1" + rev);
+      }else{
+        newpath += ((orgPath.indexOf('?') > -1 ? '&':'?') + options.suffix + '=' + rev);
+      }
       return newpath
     },
     elementAttributes :{
fix issues #1

Not replacing the hash #1