added some logs for debugging.