more general error catching, more docs