Catch exceptions and still write to the queue
Merge pull request #9 from richo/bugs/deadlocks

Catch exceptions and still write to the queue