added some logging calls