* add function to cleanly shutdown server threads