Solved some problems in server stopping