added some logging functionality