added some logging to find errors