diff --git a/index.js b/index.js
index df232af..b81a3bf 100644
--- a/index.js
+++ b/index.js
@@ -10,7 +10,7 @@ var botUsername = 'UNKNOWN';
 
 var options = {};
 
-if (Number(config.polling)) {
+if (!Number(config.polling)) {
     options.webHook = {
         port: config.webhook_port,
         key: __dirname+'/key.pem',
@@ -19,7 +19,7 @@ if (Number(config.polling)) {
 }
 var bot = new telegram(config.token, options);
 
-if (Number(config.polling)) {
+if (!Number(config.polling)) {
     bot.setWebHook(config.webhook_prefix + config.token, __dirname+'/crt.pem');
 }