Sampling Scenedepth in a PP Shader ruins fog

I have made an outline shader for our game and i modified it so it would not show outline if a something is blocking the visibility of the object being outline.
To do this i had to not only to test whether there is custom depth at a point, but also whether it is equal to scene depth ( this is exactly when i want an outline).

The Problem:
When i sample scene depth for a specific UV coordinate, the ExponentialHeightFog in our scene does not render. I suspect that the scene depth for some reason disapears after the shader has used it, any thoughts?

Sampling scene depth

In the picture if i disable the SceneDepth nodes the fog will work fine.