I had the same problem back when I was a gym rat. I found the problem was my lack of flexibility was affecting my squat technique. If your hamstrings are tight, you'll tend to roll forward on to your toes as you go down and your knees won't be able to stay in position. Try and incorporate some stretches to loosen up your hamstrings, hips and groin. Make them part of your warm up and cool down or do them on your off days.