fix #34 - better error handling using domains