working on race condition