rework to log to stdout