How To Solve Race Condition