code is almost working, can post messages to the server