use windower commands instead of prerender event to avoid rare crash