better error handling, closes #32