working on fork threadsafety