- fixed bad error handling