prevent NPE in worker thread when shutdown