Fixed thread shutdown order