added test case to check against race conditions of write with the garbage collection