Added functions for cleanup go-routines after server shutdown