working server! clean shutdown