Fix synchronous sending of messages

- create whole string before sending to avoid synchronous sending