updated code to work with new struct, also tried new client socket but failed