Move delay timeout to wait for page render, not after