error handling, closes #18