fix bug when call shut down method.