removed console.log err check