I'm so used to my 3-year-old using a "w" sound instead of a "y" sound that the other day when she said "Mom can I play with your yoga mat" she took me by surprise and I asked her to repeat herself. She said again "Mom can I play with your woga mat". Just like that, the y sound disappeared...or did it. Speech sound development isn't all or nothing. It's quite normal for children to begin producing a sound right some of the time...this is a sign that they're learning how to say it. It's also normal for a child to use a sound correctly on some words (eg. my daughter's always said "yes" perfectly) and to make errors on other words (eg. asking me for "wogurt" instead of "yogurt").
When you see correct sounds popping up in your child's speech where errors used to be made, consider it a good sign that they're on the way to mastering that sound.