update to error catching