improvements to toolbar to avoid race conditions when loading