added printError which is console.error