Foot IK glitching on stairs

I have tried several foot IK tutorials. All of them use a trace. All of then get crazy glitchy legs when the character is on stairs. How do i correct this or work around it?