adding logging.