minor change to error handling