added some debug logs.