Typo, "err" variable name should be "er".