added some logging
added debug msg