better server closing and worker disconnecting