updated autochange to wait for dom completion.