fixed race condition in Container factories