fix to replace tokens with tokens - http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format