correctly implemented complete stage flagging