err was not defined