fix client socket being initialized multiple times and having duplicate handlers