CB-4263 set ready state to done before onload