Add a check for `err` here too.