Variable err was already declared, which is why it was being overshadowed by return.