added some logging to help debug