why is ```err``` declared here?