changed console.error to console.log