Fixing the Race Condition Bug in Doctor Scheduling