another invoke_when_ready fix