Added debug logging
Added debug logging