more robust singleton to battle against compiler/linker quirks