be more specific about the exceptions we catch

patch for issue 14