fixed general error catching