Fixed sending state to server, need to fix get, and close connection