fixed livelock
fixed NPE when getting exceptions