catch every error, make sure thread will not dead if there is exception