Moved to waiting until the page completely loaded.