Add missing assignment to `err` variable