updated race condition test. Needs to implement the mock database