latch topic solves the racing condition.