fixed a bunch of bugs to get single connection client/server to work