added some logging to find the problem