basic error handling (see #42)