added locks to prevent Users collection race condition