Поставити у пасивний стан when she returned, the subject of the conversation already (to change)
When she returned, my homework had already beendone. or: When she returned, the essay had already been written. or: When she returned, the breakfast had already been eaten.