updates to error-handling