-- added debug logging