Fixed  message sending
Modified gateway