added functionality to kill server