move automation to prerender event