Add debug logging