log err2 instead of err