avoid calling debug() multiple times