added in some logging.