diff --git a/BOT.php b/BOT.php
index 0430e9c..219f1ff 100644
--- a/BOT.php
+++ b/BOT.php
@@ -2,5 +2,5 @@
 //init
 require('classes/Telegram/Base.php');
 $BOT = new DBot\Telegram\Base('unix:///tmp/tg.sck');
-require_once('init.php');
+require_once('classes/Telegram/init.php');
 ?>
\ No newline at end of file
diff --git a/classes/Telegram/Base.php b/classes/Telegram/Base.php
index 5a0bc8f..5d158cf 100644
--- a/classes/Telegram/Base.php
+++ b/classes/Telegram/Base.php
@@ -1,6 +1,5 @@
 <?php
 namespace DBot\Telegram;
-
 class Base
 {
 	protected $_fp;
@@ -12,17 +11,13 @@ class Base
 		}
 		stream_set_timeout($this->_fp, 1);
 	}
-
 	public function __destruct()
 	{
 		fclose($this->_fp);
 	}
-
-
 	public function exec($command)
 	{
 		fwrite($this->_fp, str_replace("\n", '\n', $command) . PHP_EOL);
-
 		$answer = fgets($this->_fp);
 		if (is_string($answer)) {
 			if (substr($answer, 0, 7) === 'ANSWER ') {
@@ -35,7 +30,6 @@ class Base
 				return true;
 			}
 		}
-
 		return false;
 	}
-}
+}
\ No newline at end of file
diff --git a/init.php b/classes/Telegram/init.php
similarity index 65%
rename from init.php
rename to classes/Telegram/init.php
index b3d7619..1c743a0 100644
--- a/init.php
+++ b/classes/Telegram/init.php
@@ -21,14 +21,14 @@ if($_GET['from'] != escapePeer(BOT_NAME)){
 	}
 
 //load plugins
-	$load_plugins = glob(dirname(__FILE__).DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'*.php');
+	$load_plugins = glob(PATH.'plugins'.DIRECTORY_SEPARATOR.'*.php');
 	foreach ($load_plugins as $key => $value) {
-		if ($value == dirname(__FILE__).DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'help.php') {
+		if ($value == PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php') {
 			unset($load_plugins[$key]);
 		}
 	}
 	foreach ($load_plugins as $value) {
 		require_once $value;
 	}
-	require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.'help.php';
+	require_once PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php';
 }
\ No newline at end of file
diff --git a/config.inc.php b/config.inc.php
index e2f1473..917dcf2 100644
--- a/config.inc.php
+++ b/config.inc.php
@@ -1,6 +1,7 @@
 <?php
+define('PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
 define('TAG', '#');
 define('OWNER_NAME', 'Denny Dai');
 define('BOT_NAME', 'Dx. Dennx');
 define('HELP_BEGIN', "Welcome to use TG-BOT");
-define('HELP_END', "GitHub: https://github.com/dennydai/D-bot\nAuthor: @DennyDai");
\ No newline at end of file
+define('HELP_END', "GitHub: https://github.com/dennydai/D-bot\nAuthor: @DennyDai");
diff --git a/plugins/echo.php b/plugins/echo.php
index b61a865..03e8fba 100644
--- a/plugins/echo.php
+++ b/plugins/echo.php
@@ -1,5 +1,5 @@
 <?php
 PluginList("echo", "Echo what you typed.");
 if (preg_match("/^".TAG."echo (.*)$/", $_GET['text'], $matches)) {
-	$BOT->exec("msg ".$from." ".$matches[1]);
+	$BOT->exec("msg ".$from." ".escapeString($matches[1]));
 }
\ No newline at end of file
diff --git a/plugins/trans.php b/plugins/trans.php
index aa75f0c..b633a5b 100644
--- a/plugins/trans.php
+++ b/plugins/trans.php
@@ -12,9 +12,9 @@ if (preg_match("/^".TAG."trans (.*)$/", $_GET['text'], $matches)) {
 		$to = $matches[0];
 		$text = urlencode($matches[1]);
 	}
-	$trans = file_get_contents('http://api.microsofttranslator.com/v2/ajax.svc/TranslateArray2?appId=%22TKT68kjRgkUbVtIKst6Vo0Hxnb6g2f0K3tUMyn1gZ7nc*%22&to="'.$to.'"&options={}&texts=["'.$text.'"]');
-	preg_match('/"TranslatedText":"([^"]+)/i', $trans, $trans_result);
-	$msg = "Result: ".$trans_result[1];
+	$trans = file_get_contents('http://api.microsofttranslator.com/v2/ajax.svc/TranslateArray2?appId=%22TWQET6TO9c7Iw1yXOahFm8zfEzty5DUHuaTHkl5SCrHUPgu3ABP7aflbz8teet6IS%22&to="'.$to.'"&options={}&texts=["'.$text.'"]');
+	preg_match("/\[{.*?\}]/is", $trans, $trans_json);
+	$msg = "Result: ".json_decode($trans_json[0],true)[0]["TranslatedText"];
 	$BOT->exec("msg ".$from." ".escapeString($msg));
 
 }
\ No newline at end of file