added the logging