Final update. now the server side doesnt terminate