replaced console.log with module.log and error throwing to module.fatal