added some try,catch blocks to prevent threads from quiting and crashing the app.

Ignore-this: 5b062789ce74d7a4ef62130f84f4d19e

darcs-hash:20130307053836-c21fe-3eacf173460774864b807d3696615d93377ffbda