ugly global to avoid double logging