HMB-83 fix race condition in repositories