fixed closing of server socket