added some logging to enhace debug