One thing to note is that the -02 gates don't have Schmitt trigger inputs, so they aren't designed for slow input signal level transitions. A -14, -17, -132, etc. gate will be a better choice.
Another problem is that LM358 is an op amp and not a comparator. I'm not sure if using it as a comparator will create any issues, though, but it's not supposed to be used like this.