remove some logging and transform error logging to console.error