Update index.js

Fixed sending of control packets instead of logging