changed \0 to be sent at the end of all messages