`err` needs to be checked here.