added some debug logging