Fix synchronous sending of messages

- created whole string before sending to avoid synchronous sending