replace sync::Once by manual AtomicBool check