pass err as first param of all callbacks