fixed general error case