REDO: fixed race conditionw