Avoid potential race condition (MainActivity ctor)