fix UI init race condition