Fog glitch while rendering with ultra dynamic sky

This is exactly what I did, and it looks right in the editor, but it seems to reset in rendering.