slightly modified logging.